package com.singularity.common.domain.enumeration;

import lombok.Getter;


/**
 * @author 天
 *
 * @description: 状态枚举
 */
@Getter
public enum StatusEnum {

    DISABLE(0,"禁用"),
    ENABLE(1,"启用");

    private final Integer name;

    private final String value;

    StatusEnum(Integer name, String value) {
        this.name = name;
        this.value = value;
    }

    public static Integer getName(String value){
        for (StatusEnum statusEnum : StatusEnum.values()) {
            if (value.equals(statusEnum.getValue())){
                return statusEnum.getName();
            }
        }
        return null;
    }

    public static String getValue(Integer name){
        for (StatusEnum statusEnum : StatusEnum.values()) {
            if (name.equals(statusEnum.getName())){
                return statusEnum.getValue();
            }
        }
        return null;
    }
}
